package org.jeecg.modules.xmss.service.impl;

import org.jeecg.modules.xmss.entity.XmssEvaluate;
import org.jeecg.modules.xmss.mapper.XmssEvaluateMapper;
import org.jeecg.modules.xmss.service.IXmssEvaluateService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;

/**
 * @Description: 评价表
 * @Author: jeecg-boot
 * @Date:   2020-09-18
 * @Version: V1.0
 */
@Service
public class XmssEvaluateServiceImpl extends ServiceImpl<XmssEvaluateMapper, XmssEvaluate> implements IXmssEvaluateService {

	@Autowired
	private XmssEvaluateMapper xmssEvaluateMapper;

	@Override
	@Transactional
	public void saveMain(XmssEvaluate xmssEvaluate) {
		xmssEvaluateMapper.insert(xmssEvaluate);
	}

	@Override
	@Transactional
	public void updateMain(XmssEvaluate xmssEvaluate) {
		xmssEvaluateMapper.updateById(xmssEvaluate);

		//1.先删除子表数据

		//2.子表数据重新插入
	}

	@Override
	@Transactional
	public void delMain(String id) {
		xmssEvaluateMapper.deleteById(id);
	}

	@Override
	@Transactional
	public void delBatchMain(Collection<? extends Serializable> idList) {
		for(Serializable id:idList) {
			xmssEvaluateMapper.deleteById(id);
		}
	}

}
